<?php

namespace app\courier\controller;

/**
 * 用户相关类
 * Class Common
 * @package app\user\controller
 */
class Member extends Common
{
    protected $courier_id;

    public function _initialize()
    {
        parent::_initialize();
        $obj = new \app\logic\Passport($this->str_module_name);
        $this->courier_id = $obj->_checkPassport($this->_getContentParams('passport'), $this->_getParams('platform'));
        unset($obj);
    }


    /**
     * 上传图片
     * URI:/courier/img.upload
     */
    public function uploadImg()
    {
        $obj = new \app\logic\UploadImg($this->str_module_name);
        $str_type = $this->_getContentParams('type');
        $obj->uploadImg($str_type);
    }
    /*
  * 首次设置登录密码
  * URI：/courier.password.set
  */
    public function firstPwdSet()
    {
        $password = $this->_getContentParams('password');
        _toValidate('login_pwd', $password,19025);

        $obj = new \app\logic\LoginPassword($this->str_module_name);
        $bool_res = $obj->setLoginPwdFirst($this->courier_id,$password);
        if ($bool_res) _returnData();
        _returnError(10011);
    }
}
